import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/admin/Login'
import Home from '@/components/admin/Home'
import Index from '@/components/client/Index'
import Notice from '@/components/client/notice/Notice'
import NoticeDetail from '@/components/client/notice/NoticeDetail'
import AuthorLogin from '@/components/client/AuthorLogin'
import AuthorRegister from '@/components/client/AuthorRegister'
import Console from '@/components/client/console/Console'
import Writing from '@/components/client/console/view/Writing'
import Alter from '@/components/client/console/view/Alter'
import ArticleDetail from '@/components/client/console/view/ArticleDetail'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/authorLogin',
      name: 'AuthorLogin',
      component: AuthorLogin
    },
    {
      path: '/authorRegister',
      name: 'AuthorRegister',
      component: AuthorRegister
    },
    {
      path: '/index',
      name: 'Index',
      component: Index,
      children:
      [
        {
          path: '/',
          name: 'Notice',
          component: Notice,
        },
        {
          path: '/index/noticeDetail',
          name: 'NoticeDetail',
          component: NoticeDetail,
        },
        {
          path: '/index/Console',
          name: 'Console',
          component: Console,
        },
        {
          path: '/index/writing',
          name: 'Writing',
          component: Writing,
        },
        {
          path: '/index/atler',
          name: 'Alter',
          component: Alter,
        },
        {
          path: '/index/articleDetail',
          name: 'ArticleDetail',
          component: ArticleDetail,
        },
      ]
    },
    // {path:'*',redirect: '/login'},
  ]
})
